{% extends 'TopxiaWebBundle:User:layout.html.twig' %}
{% block title %}{{'在学'|trans}}{{ setting('classroom.name')|default("班级"|trans) }} - {{ parent() }}{% endblock %}
{% set pageNav = 'learning' %}
{% block main %}
  {% if classrooms %}
    <div class="recommend-class-list row">
      {% for classroom in classrooms if classroom.status|default('') != 'closed' %}
        {% set teachers = classroom['teachers']|default(null) %}
        <div class="col-md-3 col-sm-6">
          <div class="class-item">
            <div class="class-img-wrap">
              <a class="class-img" href="{{ path('classroom_show', {id:classroom.id}) }}">
                <img class="img-responsive" src="{{ filepath(classroom.middlePicture, 'classroom.png') }}" alt="{{ classroom.title }}">
              </a>
              <div class="mask">
                <a href="{{ path('classroom_show', {id:classroom.id}) }}" class="btn btn-warning">立即加入</a>
              </div>
            </div>
            <h3><a class="link-dark" href="{{ path('classroom_show', {id:classroom.id}) }}">{{ classroom.title }}</a></h3>
            <div class="metas">共{{classroom.courseNum}}门课程</div>
          </div>
        </div>
      {% endfor %}
    </div>
  {% else %}
    <div class="empty">无在学的{{setting('classroom.name')|default("班级"|trans)}}！</div>
  {% endif %}

  {{ web_macro.paginator(paginator) }}
{% endblock %}
